package com.yc.cloud.api.enums;

import com.yc.cloud.common.basic.enums.IEnumCode;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum OrderStatusEnums implements IEnumCode {
    NO_PAY("0", "未支付"),
    PAY("1", "已支付"),
    PAY_FAIL("2", "支付失败"),
    PLAYING("3", "支付中"),

    CANCEL("4", "取消订单");


    /**
     * 状态码
     */
    final String code;
    /**
     * 消息内容
     */
    final String description;

    public static boolean isValidEnum(String code) {
        for (OrderStatusEnums fundStatusEnum : OrderStatusEnums.values()) {
            if (fundStatusEnum.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
};
